<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>团队介绍</title>
    <link rel="stylesheet" href="/css/team.css">
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/layui-v2.6.4/css/layui.css">
    <script src="/layui/layui.js"></script>
    <script src="/layui/jquery.min.js"></script>
    <script src="/layui/axios.min.js"></script>
</head>
<body>
    <!-- 头部 -->
    <div th:replace="common/common::head1"></div>
    <!-- 导航 -->
    <div th:replace="common/common::head2"></div>
    <!--横幅-->
    <div th:replace="common/common::head3"></div>
    <!-- 主体部分 -->
    <section class="main_body">
        <div class="container">
            <div class="ss">
                <div th:replace="common/common::head4"></div>
            </div>
        </div>
        <article>
                <main class="container">
                    <div >
                        <p class="ding" >团队介绍</p>
                        <p><a href="/front/index">首页>></a><a href="#">团队介绍</a></p>
                    </div>
                </main>
        </article>
    </section>
    <section class="pic_body">
        <main class="container">
            <div class="body_1" id="lawyers">

            </div>
            <div id="demo20"></div>
        </main>
    </section>
      <!-- 尾部 -->
    <div th:replace="common/common::footer"></div>
</body>
<script>
    layui.use(['form','laypage'],function () {
        var form = layui.form,laypage = layui.laypage;

        var lawyerData = []

        axios.get('/front/lawyer/getAll').then(res => {
            lawyerData = res.data.data;
        })

        setTimeout(function () {
            //调用分页
            laypage.render({
                elem: 'demo20'
                ,count: lawyerData.length
                ,limit: 6
                ,jump: function(obj){
                    //模拟渲染
                    document.getElementById('lawyers').innerHTML = function(){
                        var arr = []
                            ,thisData = lawyerData.concat().splice(obj.curr*obj.limit - obj.limit, obj.limit);
                        layui.each(thisData, function(index, item){
                            arr.push('<div class="body_text">\n' +
                                '                    <img src="'+item.lawyerImage+'" style="height: 236px;width: 236px" alt="">\n' +
                                '                    <ul>\n' +
                                '                        <li>'+item.lawyerName+'</li>\n' +
                                '                        <li>专业领域：'+item.lawyerField+'</li>\n' +
                                '                        <li>联系电话：<span>'+item.lawyerPhone+'</span> </li>\n' +
                                '                    </ul>\n' +
                                '                </div>');
                        });
                        return arr.join('');
                    }();
                }
            });
        },100)



    })
</script>
</html>
